package com.qubuyer.business.mine.adapter

import com.qubuyer.R
import com.qubuyer.business.good.activity.GoodDetailActivity
import com.qubuyer.databinding.ItemRebateOrderDetailGoodListBinding
import com.qubuyer.repository.entitys.RebateOrderEntity
import com.qubuyer.utils.NavigationUtil
import com.qubyer.widget.adapter.BindingRvAdapter

/**
 * @date 创建时间:2019/4/8
 * @author Susong
 * @description 折让订单详情商品列表adapter
 * & @version
 */
class RebateOrderDetailGoodListAdapter(mData: List<RebateOrderEntity>?) :
    BindingRvAdapter<RebateOrderEntity, ItemRebateOrderDetailGoodListBinding>(ArrayList(mData)) {

    override val itemLayout: Int
        get() = R.layout.item_rebate_order_detail_good_list

    override fun onBind(
        data: RebateOrderEntity,
        dataBinding: ItemRebateOrderDetailGoodListBinding
    ) {
        dataBinding.data = data
        dataBinding.host = this
    }

    fun onItemClick(goodsId: Int) {
        NavigationUtil.overlay(mContext, GoodDetailActivity::class.java, goodsId)
    }
}